home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / COLOR2NU.HDR < prev    next >
Text File  |  1994-04-25  |  1KB  |  43 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _Color2Num( cColor ) --> nColor
  8.  
  9. PARAMETERS:
  10.  
  11. cColor: a complete fore and back color setting attribute string
  12.  
  13. SHORT:
  14.  
  15. Convert a clipper color string to a Clipper internal color number.
  16.  
  17. DESCRIPTION:
  18.  
  19. _Color2Num() converts a color from Clipper's internal method of
  20. representation to a literal color setting string, with foreground and
  21. background, as well as high and blink characters.
  22.  
  23. It does NOT convert colors to the Clipper COLOR NUMBER (ie, n - 0, b -
  24. 1, etc).  It is typically used to read a screen region with savescreen()
  25. and determine the color of the screen at any given point.
  26.  
  27.  
  28. NOTE:
  29.  
  30. See _ReColor() for an example of how this function is properly employed.
  31.  
  32. EXAMPLE:
  33.  
  34. t = savescreen(5,10,5,10)
  35. t = substr(t,1,1)+chr(_Color2Num('w+/r'))
  36.  
  37. restscreen(5,10,5,10,t)
  38.  
  39. Result: Whatever is at screen position 5,10 is rewritten in "w+/r".  This
  40. is precisely what _Recolor() does.
  41.  
  42. ******************************************************************************/
  43.